var express = require('express');
var router = express.Router();
var Post = require('../models/posts.js');
var check = require('./check');
var checkLogin = check['checkLogin'];
var checkNotLogin = check['checkNotLogin'];

router.post('/',checkLogin);
router.post('/',function(req,res,next){
    var articleId = req.body['articleId'];
    var updateObj = req.body['updateObj'];
    Post.update(articleId,updateObj,function(err){
        if(err){
            console.log('err'+err);
            res.json({success:false,message:"文章修改成功"});
        }else{
            res.json({success:true,message:"文章修改失败"});
        }
    })
});

module.exports = router;
